﻿@using BootstrapBlazor.Components
@using TrackSystem.IO.Equip

@{
    string cls = (PartAttr.Name == CurrentName) ? "apple-btn apple-btn-success" : "apple-btn apple-btn-" + PartAttr.Catogery.ToString().ToLower();
    Color clr = PartAttr.Enabled? (PartAttr.Status? Color.Success : Color.Danger) : Color.None;
}
<Button class="@cls" OnClick="OnPartChanged">
    <div class="indicator"><Light Color="clr"></Light></div>
    <span>@PartAttr.Name</span>
</Button>

@code {
    [Parameter]
    public EquipPartAttr PartAttr { get; set; }

    [Parameter]
    public string? CurrentName { get; set; }

    [Parameter]
    public EventCallback OnPartChanged { get; set; }
}


